package com.yangl.corejava.pattern.composite;

import java.util.ArrayList;
import java.util.List;

public class Branch2 extends Corp {

	public Branch2(String name, String position, int salary) {
		super(name, position, salary);
	}
	
	private List<Corp>  subordinateList=new ArrayList<Corp>();
	
	public void addSubordinate(Corp icorp) {
		icorp.setParent(this);
		this.subordinateList.add(icorp);
	}

	public List<Corp> getSubordinate() {
		return this.subordinateList;
	}

}
